<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Copyright (c) 2017-2020 Contributors to the Eclipse Foundation
  ~
  ~ See the NOTICE file(s) distributed with this work for additional
  ~ information regarding copyright ownership.
  ~
  ~ This program and the accompanying materials are made available under the
  ~ terms of the Eclipse Public License 2.0 which is available at
  ~ http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
  ~ which is available at https://www.apache.org/licenses/LICENSE-2.0.
  ~
  ~ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<winery-modal bsModal #addModal="bs-modal" [modalRef]="addModal">
    <winery-modal-header [title]="'Add a new ' + addModalType"></winery-modal-header>
    <winery-modal-body>
        <winery-add-component-data-component #addComponentData
                                             [toscaType]="toscaType"
                                             [types]="types"
                                             [typeRequired]="typeRequired"
                                             [newComponentName]="newComponentName"
                                             [newComponentSelectedType]="newComponentSelectedType"
                                             (typeChanged)="typeSelected($event)"
                                             (newComponentNameEvent)="setNewComponentName($event)"
                                             (newComponentNamespaceEvent)="setNewComponentNamespace($event)"
                                             (validFormEvent)="setValid($event)">
        </winery-add-component-data-component>
    </winery-modal-body>
    <winery-modal-footer
        (onOk)="addComponent()"
        [closeButtonLabel]="'Cancel'"
        [okButtonLabel]="'Add'"
        [hideOnOk]="false"
        [disableOkButton]="valid || validation?.noTypeAvailable">
    </winery-modal-footer>
</winery-modal>
